# -*- coding: utf-8 -*-

import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *


class MainWindow(QWidget):

    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent=parent)
        self.setWindowTitle("QMessageBox示例")
        self.resize(300, 100)
        self.myBtn = QPushButton(self)
        self.myBtn.setText("点击弹出消息框")
        self.myBtn.clicked.connect(self.msg)

    def msg(self):
        reply = QMessageBox.information(self, "标题", "消息正文", QMessageBox.Yes|QMessageBox.No, QMessageBox.Yes)
        print(reply)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    win = MainWindow()
    win.show()
    sys.exit(app.exec())